﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Model;

namespace DAL
{
    public class ReportExtService
    {
        public ReportExt GetReportExtById(int id)
        {
            ReportExt result = new ReportExt();

            using (SjDcEntities sjDc = new SjDcEntities())
            {
                result.MyReportSet = sjDc.ReportSet.AsNoTracking().Where (s=>s.ID ==id).SingleOrDefault ();
                result.ReportInfoList = sjDc.ReportInfo.AsNoTracking().Where(s => s.FkId == id).ToList();
            }

            return result;
        }
    }
}
